﻿using System;
using System.Collections.Generic;
using Acaweb.Data.Contracts;
using Acaweb.Model.Entities;
using Acaweb.Model.Entities.DatosCompuestos;
using Spring.Transaction.Interceptor;

namespace Acaweb.Data.Dao.NHibernate
{
    public class PrerequisitosDao : HibernateDao<Prerequisitos,PrerequisitosPk>, IPrerequisitosDao
    {
        [Transaction(ReadOnly = true)]
        public IList<Prerequisitos> GetAll()
        {
            return GetAll<Prerequisitos>();
        }

        [Transaction(ReadOnly = true)]
        public IList<Prerequisitos> GetMaterias(int Materia, int PlanEstudio, int Pensum)
        {
            return this.Session.QueryOver<Prerequisitos>().Where(t => t.PrerequisitoPk.CodigoMateria == Materia &&
                t.PrerequisitoPk.CodigoPlan == PlanEstudio && t.PrerequisitoPk.CodigoPensum == Pensum).List();
        }
    }
}
